/*
 * Atributo.java
 * 
 * Copyright (C) 2008 David Castellanos Serrano
 * 
 * This program is free software: you can redistribute it and/or modify
 * it under the terms of the GNU General Public License as published by
 * the Free Software Foundation, either version 3 of the License, or
 * (at your option) any later version.
 * 
 * This program is distributed in the hope that it will be useful,
 * but WITHOUT ANY WARRANTY; without even the implied warranty of
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
 * GNU General Public License for more details.
 * 
 * You should have received a copy of the GNU General Public License
 * along with this program.  If not, see <http://www.gnu.org/licenses/>.
 */

package dpoo.figuras;

/**
 * Modela el comportamiento de un Atributo
 * @author david
 */
public class Atributo extends Parametro {

    private ModVisi modVisi;
    
    /**
     * Crea un objeto de tipo Atributo
     * @param nombre
     * @param tipo
     * @param visibilidad
     * @param mAbstracto
     * @param mFinal
     * @param mEstatico
     */
    public Atributo(String nombre, int tipo,
            int visibilidad, boolean mAbstracto, boolean mFinal, boolean mEstatico) {
        this.setNombre(nombre);
        this.setTipo(tipo);
        this.modVisi = new ModVisi(visibilidad, mAbstracto, mFinal, mEstatico);
    }
    
    
    /**
     * Devuelve el estado de los modificadores y la visibilidad del Atributo
     * @return
     */
    public ModVisi getModVisi() {
        return this.modVisi;
    }
    
    
    /**
     * Devuelve una representación como String del objeto Parametro
     * @return
     */
    @Override
    public String toString() {
        return this.modVisi.toString() + " " + super.toString();
    }
}
